package com.ag.hmk.action;

import java.util.List;

import com.ag.bean.TbOverRequest;
import com.ag.common.BaseAction;
import com.ag.hmk.service.impl.HmkUiltServImpl;

public class FindOneTaskOverReqAction extends BaseAction {

	private static final long serialVersionUID = 5717329242106238029L;
	
	private HmkUiltServImpl hmkUiltServImpl;
	private String torID;
	private TbOverRequest overRequest; //返回结果
	
	public String findOneTOR()throws Exception{
		System.out.println("=====vvvvvvvvv");
		String hql = "from TbOverRequest tor left join fetch tor.tbTask tt left join fetch " +
		" tt.tbTaskStatus  where tor.toId ='"+torID+"'";
		TbOverRequest or1 = new TbOverRequest();
		List result=null;

		try {
			result = hmkUiltServImpl.hqlQuery(hql);
			if (result!=null) {
				or1 =(TbOverRequest) result.iterator().next();
				System.out.println("======ok");
			}
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("vvvvvvvv");
		}
		this.setOverRequest(or1);
		System.out.println("========ok");
		return "findOneOverReqOK";
	}
	
	
	public TbOverRequest getOverRequest() {
		return overRequest;
	}
	public void setOverRequest(TbOverRequest overRequest) {
		this.overRequest = overRequest;
	}
	public void setHmkUiltServImpl(HmkUiltServImpl hmkUiltServImpl) {
		this.hmkUiltServImpl = hmkUiltServImpl;
	}
	public void setTorID(String torID) {
		this.torID = torID;
	}
	
	

}
